package com.ibm.rules;


public class RangeEndPoint implements Comparable<RangeEndPoint>{
	public enum PointType{
		Start, End
	}
	
	private PointType pointType;
	private int ruleId;
	public RangeEndPoint(PointType pointType, int ruleId) {
		setPointType(pointType);
		this.ruleId = ruleId;
	}

	public PointType getPointType() {
		return pointType;
	}

	private void setPointType(PointType pointType) {
		this.pointType = pointType;
	}

	public int getRuleId() {
		return ruleId;
	}

	@Override
	public int compareTo(RangeEndPoint o) {
		if(this.ruleId != o.ruleId)
			return this.ruleId - o.ruleId;
		if(this.pointType != o.getPointType())
			return this.pointType == PointType.Start? -1 : 1;
		
		return 0;
	}


}
